# coding=utf-8

class Mapping:
    def __init__(self, iterable):
        self.items_list = []
        self.__update(iterable)

    def update(self, iterable):
        for item in iterable:
            self.items_list.append(item)

    __update = update   # private copy of original update() method

class MappingSubclass(Mapping):

    def update(self, keys, values):
        # provides new signature for update()
        # but does not break __init__()
        for item in zip(keys, values):
            self.items_list.append(item)

if __name__ == '__main__':
    m = Mapping([1, 2, 3])
    print 'm1', m.items_list

    m.update([4, 5, 6])
    print 'm1', m.items_list

    m2 = MappingSubclass([1, 2, 3])
    print 'm2', m2.items_list
    m2.update([4, 5, 6],[7, 8, 9])
    print 'm2', m2.items_list

    m2._Mapping__update([10, 11, 12])
    print 'm2', m2.items_list

    # print dir(m)
    # print dir(m2)
